<?php
//The next comment block is for PHPDocumentor
/**
 * Conference Registration - Registration for conferences
 * 
 * Admin menu option:
 * Reports
 * 
 * @author Kevin van Haaren (kevin@vanhaaren.net)
 * @copyright 2006 Kevin van Haaren, US
 * @package CONFREG
 * @subpackage Admin_Function
 * 
 */

/**
* Do all the declarations etc needed by an admin page
*/
include_once "adminheader.inc";

//Display the admin menu
xoops_module_admin_menu(6,_AM_CONFREG_ADMENU5);

// clean data passed to the form
$cleanPost = cleanInput($_POST);
$submit = $cleanPost['submit'];

// no options selected yet
switch (TRUE) {

case (!isset($cleanPost['conf_id'])):
	$conferences = get_list_confs();

	echo "<table width=90%>\n";
	echo '<tr><th width=10% style="text-align:center;">Conf ID</th><th style="text-align:center;">Title</th><th width=15% style="text-align:center;">Start Date</th><th width=15% style="text-align:center;">Report</th></tr>' . "\n";
	if (count($conferences) > 0) {
		foreach ($conferences as $confData) {
			echo "<tr>";
			echo '<td style="text-align:center;">' . $confData['conf_id'] . "</td>";
			echo "<td>" . $confData['title'] . "</td>";
			echo '<td style="text-align:right;">' . substr($confData['start_date'],0,10) . "</td>";
			echo '<td style="text-align:center;"><form action="admenu5.php" method=post><input type=hidden name="conf_id" value="' . $confData['conf_id'] . '"><input type=submit name="submit" value="Goto Reports"></form></td>';
			echo "</tr>\n";
		}
	} else {
		echo "<tr><td colspan=6>No conferences defined yet.</td></tr>";
	}
	echo "</table></div><br /><br />";
	break;

case ($submit == 'Goto Reports'):
	echo '<form action="pdf_report.php" method=post><input type=hidden name="conf_id" value="' . intval($cleanPost['conf_id']) . '"><input type=submit name="submit" value="Summary PDF"></form>';
	echo '<form action="user_report.php" method=post><input type=hidden name="conf_id" value="' . intval($cleanPost['conf_id']) . '"><input type=submit name="submit" value="User Report"></form>';
	echo '<form action="pdh_report.php" method=post><input type=hidden name="conf_id" value="' . intval($cleanPost['conf_id']) . '"><input type=submit name="submit" value="PDH Report"></form>';
	echo generate_reports(intval($cleanPost['conf_id']));
	break;
}

echo '<p><p>';
xoops_cp_footer();

/*
 * This file was generated by XBS ModGen, (c) 2006 A Kitson, UK. See http://xoobs.net
 * ModGen is a Module Code Generator for the Xoops CMS.  See http://xoops.org
 */
?>